package cn.qiuyiping.module.entity;

import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

public class AnimalTest {

    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.setId(1);
        dog.setName("小狗");
        List<DogChild> children = new ArrayList<>();
        DogChild childOne = new DogChild();
        childOne.setColor("red");
        children.add(childOne);
        DogChild childTwo = new DogChild();
        childTwo.setColor("yellow");
        children.add(childTwo);
        dog.setChildren(children);

        Cat cat = new Cat();
        BeanUtils.copyProperties(dog, cat);
        System.out.println("over");
    }

}
